#include <cstdio>
#include <stdlib.h>

#define STRING_LENGTH 100

int main()
{
    char str[STRING_LENGTH + 1] = {0};
    while (gets(str) != NULL) {
        int pos = 0;
        while (true) {
            if (str[pos] == '\0') {
                break;
            }

            if (pos == 0) {
                if (str[pos] > 'Z') 
                    str[pos] += 'A' - 'a';
                pos++;
                continue;
            } 

            if (str[pos] == ' ') {
                pos++;
                continue;
            }

            if (str[pos-1] == ' ' || str[pos-1] == '\t' || str[pos-1] == '\n') {
                if (str[pos] > 'Z')
                    str[pos] += 'A' - 'a';
                pos++;
                continue;
            }

            pos++;
        }
        printf("%s\n", str);
    }
}